/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ep.m002.ui.views;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import ep.libs.implementations.AbstractModule;
import ep.libs.implementations.AbstractView;
import ep.m008.module.M008Module;

/**
 *
 * @author Spyros
 */
public class M002DepView extends AbstractView {

    public M002DepView(AbstractModule module) {
        super(module);
    }

    public M002DepView(AbstractModule module, Object[] args) {
        super(module, args);
    }

    @Override
    public ComponentContainer getView() {
        initializeComponents();
        return viewLayout;
    }

    private void initializeComponents() {
        Panel panel = new Panel("Διαχείριση φαρμάκων");
        panel.setHeight("300px");

        Button medButton = new Button("Σκευάσματα");
        Button subButton = new Button("Ουσίες");

        subButton.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                module.getApplication().changeModule(M008Module.class);
            }
        });

        panel.addComponent(new Label("<br/><br/>", Label.CONTENT_RAW));
        panel.addComponent(medButton);
//        panel.setComponentAlignment(medButton, Alignment.MIDDLE_LEFT);
        panel.addComponent(new Label("<br/>", Label.CONTENT_RAW));
        panel.addComponent(subButton);
//        panel.setComponentAlignment(subButton, Alignment.MIDDLE_LEFT);

        viewLayout.addComponent(panel);
    }
}
